﻿@{
    Layout = "";
    var ThemeList = new List<string>()
    {
        "default","black","bootstrap","gray","material","material-blue","material-teal",
        "metro","metro-blue","metro-gray","metro-green","metro-orange","metro-red","ui-cupertino","ui-dark-hive",
        "ui-pepper-grinder","ui-sunny"
    };
    var random = new Random();
    var themeIndex = random.Next(0, ThemeList.Count);
    themeIndex = 0;
    int.TryParse(ViewData["Permission"]?.ToString(), out var permissions);

}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>@ViewData["Title"] </title>
    <link href="~/lib/jquery-easyui/themes/@ThemeList[themeIndex]/easyui.css" rel="stylesheet" id="PageThemeHref" />
    <link href="~/lib/jquery-easyui/themes/icon.css" rel="stylesheet" />
    <link href="~/lib/jquery-easyui/themes/jquery-extension-icons/icon-metro.css" rel="stylesheet" />
    <link href="~/css/site.css" rel="stylesheet" />
    <script src="~/lib/jquery-easyui/jquery.min.js"></script>
    <script src="~/lib/jquery-easyui/jquery.easyui.min.js"></script>
    <script src="~/lib/jquery-easyui/locale/easyui-lang-zh_cn.js"></script>
    <script src="~/lib/jquery-easyui/plugins/datagrid-cellediting.js"></script>
    <script src="~/js/G.js"></script>
    <script src="~/js/commonFunc.js"></script>
    <script src="~/js/site.js"></script>

    <style>
        body {
            margin: 0px;
            padding: 0px;
            font-size: 8px;
        }

        .operationBtn {
            width: 100px;
        }

    </style>

</head>
<body>
    <div class="easyui-panel" style="width:200px;height:100px" data-options="fit:true,border:false">
        <div id="center-tools">

            @if ((permissions & 2) == 2)
            {
                <a href="javascript:void(0)" class="easyui-linkbutton operationBtn" data-options="plain:true,iconCls:'icon-add1'" onclick="QTools.AddModel()">新增</a>
            }
            @if ((permissions & 4) == 4)
            {
                <a href="javascript:void(0)" class="easyui-linkbutton operationBtn" data-options="plain:true,iconCls:'icon-edit'" onclick="QTools.UpdateModel()">修改</a>
            }
            @if ((permissions & 8) == 8)
            {
                <a href="javascript:void(0)" class="easyui-linkbutton operationBtn" data-options="plain:true,iconCls:'icon-cancel'" onclick="QTools.DeleteModel()">删除</a>
            }
            @if ((permissions & 1) == 1)
            {
                <a href="javascript:void(0)" class="easyui-linkbutton operationBtn" data-options="plain:true,iconCls:'icon-search'" onclick="QTools.QueryModel()">查询</a>
            }
            @RenderSection("tools",false)
        </div>

        <div class="">
            <form id="queryForm">
                @RenderSection("queryForm",false)
            </form>
        </div>
        @RenderBody()
    </div>
   
    <script>
        var QTools = {
            AddModel: function () { },
            UpdateModel: function () { },
            DeleteModel: function () { },
            QueryModel: function () { }
        }
    </script>
    @await RenderSectionAsync("Scripts", required: false)
</body>
</html>